package com.example.product.biz.service.impl;

import com.example.product.biz.domain.dto.CategoryAddDTO;
import com.example.product.biz.domain.po.Category;
import com.example.product.biz.mapper.CategoryMapper;
import com.example.product.biz.service.CategoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class CategoryServiceImpl implements CategoryService {

    private final CategoryMapper categoryMapper;
    /**
     * 添加分类
     *
     * @param categoryAddDTO
     */
    @Override
    public void addCategory(CategoryAddDTO categoryAddDTO) {
        Category category=new Category();
        BeanUtils.copyProperties(categoryAddDTO, category);
        categoryMapper.insertCategory(category);

    }
}
